home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-09-28 | 1.2 KB | 35 lines |
- /*
- A GUI version of the SwingApplet sample from Sun.
- - A very simple example of a JApplet.
- */
-
- import com.sun.java.swing.*;
- import java.awt.*;
-
- public class SwingApplet extends JApplet
- {
- public void init()
- {
- // This line prevents the "Swing: checked access to system event queue" message seen in some browsers.
- getRootPane().putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);
-
- // This code is automatically generated by Visual Cafe when you add
- // components to the visual environment. It instantiates and initializes
- // the components. To modify the code, only use code syntax that matches
- // what Visual Cafe can generate, or Visual Cafe may be unable to back
- // parse your Java file into its visual environment.
- //{{INIT_CONTROLS
- getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER,5,5));
- setSize(240,74);
- JButton1.setText("Hello, I'm a Swing Button!");
- JButton1.setActionCommand("Hello, I'm a Swing Button!");
- getContentPane().add(JButton1);
- JButton1.setBounds(31,5,177,25);
- //}}
- }
-
- //{{DECLARE_CONTROLS
- com.sun.java.swing.JButton JButton1 = new com.sun.java.swing.JButton();
- //}}
- }
-